package com.rayc.mall.common.context;

/**
 * @Author: Ray-C
 * @CreateTime: 2025-03-23
 * @Description: 管理员标记上下文
 * @Version: 1.0
 */
public class AdminContext {
    private static final ThreadLocal<Boolean> THREAD_LOCAL = new ThreadLocal<>();

    public static void setAdmin(Boolean isAdmin) {
        THREAD_LOCAL.set(isAdmin);
    }

    public static Boolean isAdmin() {
        return THREAD_LOCAL.get();
    }

    public static void removeAdmin(){
        THREAD_LOCAL.remove();
    }
}
